﻿using System.Collections.Generic;
using ScoutersLog.DataAccess.Persistence;

namespace ScoutersLog.Model.Factory
{
    public class CouncilFactory
    {
        public static Council GetCouncil(int councilId)
        {
            return (Council) SharedSession.Get(typeof (Council), councilId);
        }
        public static IList<Council> GetCouncilList()
        {
            return SharedSession.LoadList<Council>("Name");
        }
        public static void DeleteCouncil(int councilId)
        {
            DeleteCouncil(GetCouncil(councilId));
        }
        public static void DeleteCouncil(Council council)
        {
            SharedSession.Delete(council);
        }
        public static void Save(Council council)
        {
            SharedSession.SaveOrUpdate(council);
        }
    }
}
